package com.bm.repair.list;

import com.bm.warehouse.ArrayOfParts;
import com.bm.warehouse.IWarehouseService;
import com.bm.warehouse.Parts;
import com.bm.warehouse.Warehouse;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.JOptionPane;

/**
 * @author Eirik Luka n7696698
 */
public class PartList extends ArrayList<Parts> {
    
    Warehouse service = new Warehouse();
    IWarehouseService port = service.getBasicHttpBindingIWarehouseService();

    
    public PartList(){
        
        ArrayOfParts array = port.getParts();
        
        List<Parts> partList = (List<Parts>) array.getParts();
        
        System.out.println("Size " + partList.size());
        System.out.println("Size " + array.getParts().size());

        this.addAll(partList);
        
        for(int i = 0; i < partList.size(); i++){
             System.out.println("List: " + partList.get(i).getName().getValue() );

        }

    }

}
